package cn.weezoo.jni;

/**
 * @author wenei
 * @date 2021-02-26 11:27
 */
public class Test {

    public static void main(String[] args) {
        String osName = System.getProperties().getProperty("os.name");
        if (osName.contains("Windows")) {
            System.out.println("windows platform");
            System.load(Thread.currentThread().getContextClassLoader().getResource("libhello.dll").getPath());
            NativeCpp nativeCpp = new NativeCpp();
            nativeCpp.hello();
        } else if (osName.contains("Linux")) {
            System.out.println("linux platform");
            // 改成本机的so所在的路径
            System.load("/home/gitee/jni-demo/src/main/resources/libhello.so");
            NativeCpp nativeCpp = new NativeCpp();
            nativeCpp.hello();
        } else {
            System.out.println("other platform");
        }

    }
}
